home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 February / PCWorld_2007-02_cd.bin / domacnost a kancelar / avedesk / AveDesk13.exe / Effects / Magnification.effectlet < prev    next >
Text File  |  2005-02-15  |  3KB  |  129 lines

  1. <!--
  2.   preamble stuff you might say to someone
  3.   willing to open this in a text editor.
  4. -->
  5.  
  6. <?xml version="1.0" encoding="UTF-8"?>
  7. <effectlet>
  8.     <info>
  9.         <name>Magnification Effect Script</name>
  10.         <author>Andreas Verhoeven</author>
  11.         <notes><![CDATA[
  12.         Makes your icon bigger on mouseover.
  13.         ]]></notes>
  14.         <version>1.0.0</version>
  15.     </info>
  16.     <settings>
  17.         <param name="Debug" type="Boolean" defval="False"/>
  18.     </settings>
  19.     <preferences>
  20.         <preference name="Percentage" type="Integer" defval="33" >
  21.         Defines the amount the icon will be magnified to.
  22.         </preference>
  23.     </preferences>
  24.     <images>
  25.     </images>
  26.     <script engine="vbScript"><![CDATA[
  27.  
  28.     Dim origCX, origCY, origX, origY
  29.     Dim magnified
  30.  
  31.     'These routines are the optional ones called by the framework
  32.     Sub OnCreate()
  33.     magnified = false
  34.  
  35.         'And Reading overwrites them with some previous user changes
  36.         Preferences.ReadAll()
  37.     End Sub
  38.  
  39.     Sub OnMouseOn()
  40.     origX  = Desklet.Left
  41.     origY  = Desklet.Top
  42.     origCX = Desklet.Width
  43.     origCY = Desklet.Height
  44.     magnified = true
  45.  
  46.     Dim nwx, nwy
  47.     nwx = Desklet.Width * Percentage.Value / 100
  48.     nwy = Desklet.Height * Percentage.Value / 100
  49.     Desklet.Move cint(origX - nwx / 2), cint(origY - nwy / 2), origCX + nwx, origCY + nwy
  50.     End Sub
  51.  
  52.     Sub RestoreOrig()
  53.     if magnified then 
  54.         Desklet.Move origX, origY, origCX, origCY
  55.         magnified = false
  56.     end if
  57.     End Sub
  58.  
  59.     Sub OnMouseout()  
  60.     RestoreOrig
  61.     End Sub
  62.  
  63.     'Function OnBeforeDraw(IsMouseOn, IsSelected, IsPreview)
  64.     'End Function
  65.  
  66.     'Function OnAfterDraw(IsMouseOn, IsSelected, IsPreview)
  67.     'End Function
  68.     
  69.     Sub OnSave()
  70.         Preferences.SaveAll 
  71.     End Sub
  72.  
  73.     'Optional. Indicates a preference change
  74.     Function OnPreferenceChange(Preference, oldValue, newValue)
  75.     End Function
  76.  
  77.  
  78.     'You can only have 1 Ticker per effectlet
  79.     'The OnTimer method is shielded against multiple entrance recursion
  80.     Sub OnTimer()
  81.     End Sub
  82.  
  83.     'Optional calls that we don't need for this script:
  84.  
  85.     'Sub OnSelect()   
  86.     'End Sub
  87.  
  88.     'Sub OnDeselect()   
  89.     'End Sub
  90.  
  91.     'Sub OnShow()         
  92.     'End Sub
  93.  
  94.     'Sub OnHide()         
  95.     'End Sub
  96.  
  97.     'Sub OnConfigure() 
  98.         'the configuration dialog with default UI for
  99.         'XML preferences will be shown.
  100.         'An additional dialog designer is on its way. It will
  101.         'extend the available default preferences of type:
  102.         ' - slider, checkbox, combobox (builtin, v. 1.1, free on form with v. 1.2)
  103.         ' - textbox, file browser, favorites URL (builtin and free on form, v. 1.2)
  104.         ' - Any ocx (external, only free on form, v. 1.2)
  105.     'End Sub
  106.  
  107.     Sub OnStartMove() 
  108.     RestoreOrig
  109.     End Sub
  110.  
  111.     Sub OnEndMove()
  112.     
  113.     End Sub
  114.  
  115.     'Sub OnLeftClick()  
  116.     'RestoreOrig
  117.     'End Sub
  118.  
  119.     Sub OnRightClick()
  120.     RestoreOrig
  121.     End Sub
  122.  
  123.     'Sub OnDestroy
  124.     'End Sub
  125.  
  126.  
  127.     ]]></script>
  128. </effectlet>
  129.